<%--
  Created by IntelliJ IDEA.
  User: 31525
  Date: 10/13/2023
  Time: 12:15 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        body {
            font-family: Arial, sans-serif;
        }
        .container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            margin: 20px;
        }
        .product {
            border: 1px solid #ccc;
            border-radius: 5px;
            padding: 20px;
            margin: 10px;
            width: 300px;
            text-align: center;
        }
        img {
            max-width: 100%;
            height: auto;
        }
        h2 {
            margin: 10px 0;
        }
    </style>
</style>
</head>
<body>
<div class="container">
    <div class="product">
        <img src="product1.jpg" alt="Product 1">
        <h2>Product 1</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero.</p>
        <p><strong>Price: $99.99</strong></p>
        <button onclick="addToCart('product1')">Add to Cart</button>
        <button onclick="buyNow('product1')">Buy Now</button>
    </div>
</div>
<script>
    function addToCart(productId) {
        // 在这里添加将产品添加到购物车的代码
        alert('Added ' + productId + ' to cart');
    }

    function buyNow(productId) {
        // 在这里添加立即购买的代码
        alert('Bought ' + productId);
    }
</script>
</body>
</html>
